package com.ying.dogying.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ying.dogying.entity.dto.ImPostDto;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/im-main")
public class IndexController extends BaseController{

    /**
     * 查询全部文章信息(分页)
     */
    @GetMapping("/index")
    public String index() {
        // 1.分页信息  2.分类  3.用户  4.置顶  5.精选  6.排序
        IPage<ImPostDto> postList = imPostService.selectByParams(getPage(), null, null, null, null, "CREATE_TIME");
        request.setAttribute("postList", postList);
        request.setAttribute("currentCategoryId", 0);
        return "index";
    }

}
